package tag

import org.apache.commons.lang.StringUtils
import org.apache.spark.sql.Row

object AreaTags extends Tags {
  override def makeTags(args: Any*): List[(String, Int)] = {
    //获取参数row
    val row = args(0).asInstanceOf[Row]
    //创建list
    var list = List[(String,Int)]()
    val pname = row.getAs[String]("provincename")
    val cname = row.getAs[String]("cityname")
    if (StringUtils.isNotEmpty(pname)) {
      list :+= ("ZP" + pname, 1)
    }
    if (StringUtils.isNotEmpty(cname)) {
      list :+= ("ZC" + cname, 1)
    }
    list
  }
}
